this.name      = "cobraClipper"; 
this.author    = "eric walch"; 
this.copyright = "";
this.description = "ship script cobraClipper";
this.version   = "1.0";

/*
The original rescueship tried to only find escapepods. This never worked. The used command scanForNearestShipWithRole excludes any cargo. 
Only scanForLoot would work, but that mainly finds barrels. Therefor
*/

this.findPods = function()
{
	function isEscapePod(entity) { return entity.isShip && entity.primaryRole == "escape-capsule"};
	var pod = system.filteredEntities(this, isEscapePod, this.ship, this.ship.scannerRange)[0];
	if(pod)
	{
		if(this.ship.cargoSpaceUsed == this.ship.cargoCapacity) 
		{
			this.ship.reactToAIMessage("HOLD_FULL")
		}
		else
		{
			this.ship.target = pod
			this.ship.reactToAIMessage("ESCAPEPOD_FOUND")
		}
	}
}
